
import { Modal, Button } from 'antd';
import React, { useState } from 'react';
import type {ProColumns} from "@ant-design/pro-components";
const { confirm } = Modal;

const ViewModel = () => {
  const [visible, setVisible] = useState(false);
  const [infoContent, setInfoContent] = useState('');
  const showInfoModal = (content) => {
    setInfoContent(content);
    setVisible(true);
  };
  const handleCancel = () => {
    setVisible(false);
  };
  return (
    <>
      {/* 表格部分（假设表格在其他地方渲染） */}
      <Modal
        title="实例信息详情"
        visible={visible}
        onCancel={handleCancel}
        width="80%"
        footer={null}
      >
        <p>{infoContent}</p>
      </Modal>
    </>
  );
};
const columns: ProColumns<API.MrsHosts>[]  = [
  {
    title: '实例信息',
    dataIndex: 'info',
    valueType: 'option',
    render: (_, record) => [
      <Button
        key="config"
        onClick={() => {
          new ViewModel().showInfoModal(record.instances);
        }}
      >
        查看
      </Button>,
    ],
  },
];
export default ViewModel;
